{% extends "student/stu_header.html" %}
{% block context %}
    <div class="page_header">
        <h3 align="center">确认收货</h3>
    </div>
    <div class="container">
        <table class="table table-hover">
            <tr>
                <th scope="col">商品编号</th>
                <th scope="col">商品价格</th>
                <th scope="col">确认</th>

            </tr>
            </thead>
            <tbody>
            {% for product in products %}
                <tr>
                    <td>{{ product.product_id }}</td>
                    <td>{{ product.price }}</td>
                    {% if product.received == 0 %}
                        <td><button type="submit" class="btn btn-primary" onclick="window.location.href='/received_products?product_id={{ product.product_id }}'">确认收货</button></td>
                    {% else %}
                        <td><button type="button" class="btn btn-default" disabled="disabled">已经收货</button></td>
                    {% endif %}
                </tr>
            {% empty %}
                <div class="alert alert-info" role="alert">
                    <strong>抱歉 </strong>
                    你还没有待确认的商品，快去<a href="/stu_pro_purchase" style="color: blue"><span class="glyphicon glyphicon-hand-right"></span>商品页面</a>看看吧  
                </div>
            {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock context %}